<?php

namespace app\shop\controller\api;

use app\ApiController;
use app\shop\model\StoreModel;
use think\Db;

use app\shop\model\CartModel;
use app\member\model\UserAddressModel;
use app\member\model\AccountModel;
use app\shop\model\BonusModel;
use app\shop\model\OrderModel;
use app\shop\model\OrderGoodsModel;
use app\shop\model\GoodsModel;
use app\shop\model\CategoryModel;
use app\shop\model\BonusListModel;
/*------------------------------------------------------ */
//-- 购物相关API
/*------------------------------------------------------ */

class Store extends ApiController
{
    /*------------------------------------------------------ */
    //-- 优先执行
    /*------------------------------------------------------ */
    public function initialize()
    {
        parent::initialize();
        $this->Model = new StoreModel();
    }
    /*------------------------------------------------------ */
    //-- 添加购物车
    /*------------------------------------------------------ */
    public function lst()
    {
        $latitude = input('latitude', '', 'trim');
        $longitude = input('longitude', '', 'trim');
        $ids = input('ids', '', 'trim');
        $limit = input('limit', 10);
        $where = [];
        $where[] = ['status','=',1];
        $where[] = ['is_del','=',0];
        if($ids){
            $where[] = ['id','in',$ids];
        }
        if(!$latitude) $latitude = 23.084033;
        if(!$longitude) $longitude = 113.317451;
        $list = $this->Model->getList($where,$longitude,$latitude,$limit);
        return $this->success($list);
    }



}
